layui.use('table', function() {
	var table = layui.table,
		layer = layui.layer;
    
    
    var $ = layui.$,
		active = {
			reload: function() {
				var start = $('#start').val();
				var end = $('#end').val();

				//执行重载
				table.reload('idTest', {
					page: {
						curr: 1 //重新从第 1 页开始
					},
					where: {
						key: {
							start: start,
							end: end
						}
					}
				});
			}
		};

	$('.right-center #ScreenBnt').on('click', function() {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});
    
    
	layer.msg('数据加载中...', {
		icon: 16,
		shade: 0.3,
		success: function() {
			table.render({
				elem: '#centet-cen',
				url: listSrc,
				height: $(".center-tab").height(),
				id: 'idTest',
				response: {
					statusCode: 1, //成功的状态码，默认：0
				},
				page: true,
				cols: [
					[ //标题栏
						{
							field: 'id',
							title: 'ID',
							width:80
						}, {
							field: 'mid',
							title: '业绩来源'
						}, {
							field: 'type_remark',
							title: '类型'
						}, {
							field: 'score',
							title: '新增业绩'
						}, {
							field: 'create_date',
							title: '时间'
						}

					]
				],
				limit: 20
			});
			layer.close(layer.index)
		}
	});

	

})

layui.use(['form', 'layedit', 'laydate'], function() {
	var form = layui.form,
		layer = layui.layer,
		layedit = layui.layedit,
		laydate = layui.laydate;
		
		laydate.render({
			elem: '#start'
		});
		laydate.render({
			elem: '#end'
		});
})

$(function() {
	$("#Expbnt").click(function() {
		$("#screen-form").attr("action", ExpSrc);
	})

})